package com.holdtime.jtt809.taxi.module.entity.mapper;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import com.holdtime.jtt809.taxi.module.entity.DmsAlarmDO;
import com.holdtime.jtt809.taxi.module.model.vo.DmsAlarmPageReqVO;
import org.apache.ibatis.annotations.Mapper;

/**
 * dms报警记录 Mapper
 *
 * @author 超级管理员
 */
@Mapper
public interface DmsAlarmMapper extends BaseMapperX<DmsAlarmDO> {

    default PageResult<DmsAlarmDO> selectPage(DmsAlarmPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<DmsAlarmDO>()
                .eqIfPresent(DmsAlarmDO::getVehicleNo, reqVO.getVehicleNo())
                .eqIfPresent(DmsAlarmDO::getVehicleColor, reqVO.getVehicleColor())
                .eqIfPresent(DmsAlarmDO::getWarnSrc, reqVO.getWarnSrc())
                .eqIfPresent(DmsAlarmDO::getWarnType, reqVO.getWarnType())
                .betweenIfPresent(DmsAlarmDO::getWarnTime, reqVO.getWarnTime())
                .eqIfPresent(DmsAlarmDO::getInfoId, reqVO.getInfoId())
                .eqIfPresent(DmsAlarmDO::getDriver, reqVO.getDriver())
                .eqIfPresent(DmsAlarmDO::getDriverNo, reqVO.getDriverNo())
                .eqIfPresent(DmsAlarmDO::getLevel, reqVO.getLevel())
                .eqIfPresent(DmsAlarmDO::getLon, reqVO.getLon())
                .eqIfPresent(DmsAlarmDO::getLat, reqVO.getLat())
                .eqIfPresent(DmsAlarmDO::getAltitude, reqVO.getAltitude())
                .eqIfPresent(DmsAlarmDO::getVec1, reqVO.getVec1())
                .eqIfPresent(DmsAlarmDO::getVec2, reqVO.getVec2())
                .eqIfPresent(DmsAlarmDO::getStatus, reqVO.getStatus())
                .eqIfPresent(DmsAlarmDO::getDirection, reqVO.getDirection())
                .eqIfPresent(DmsAlarmDO::getInfoContent, reqVO.getInfoContent())
                .betweenIfPresent(DmsAlarmDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(DmsAlarmDO::getId));
    }

}